package com.example.understandvideo.service.transcode;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

@Data// lombok注解，给字段添加getter和setter
@XmlAccessorType(XmlAccessType.FIELD)// 映射所有的字段
@XmlRootElement(name = "filearchive")// XML根节点名称，此处为user
@AllArgsConstructor
@NoArgsConstructor
@XmlType(propOrder = {"active"
        , "container"
        , "tssetting"
        , "description"
        , "uri"
        , "targetname"
        , "extension"
        , "segmenttype"
        , "segmentcontainer"
        , "segmentname"
        , "playlistname"
        , "usesubdirectories"
        , "singleM3u8"
        , "iframeplaylist"
        , "byterangemode"
        , "playlisttype"
        , "timecodemode"
        , "ivfollowssegment"
        , "keyprovidertype"
        , "audiogroupenabled"
        , "output"})

public class CloudOutputGroupsFileArchive {
    private String active;
    private String container;
    private CloudOutputGroupsFileArchiveTsSetting tssetting;
    private String description;
    private String uri;
    private String targetname;
    private String extension;
    private String segmenttype;
    private String segmentcontainer;
    private String segmentname;
    private String playlistname;
    private String usesubdirectories;
    private String singleM3u8;
    private String iframeplaylist;
    private String byterangemode;
    private String playlisttype;
    private String timecodemode;
    private String ivfollowssegment;
    private String keyprovidertype;
    private String audiogroupenabled;
    private CloudOutputGroupsFileArchiveOutput output;

    public static CloudOutputGroupsFileArchive getDefault(String targetDir, String targetFilename) {
        return new CloudOutputGroupsFileArchive("1", "MP4",
                new CloudOutputGroupsFileArchiveTsSetting("0", "0", "", "", "", "", "-1", "", "", "", "", "", "", "", "0"),
                "输出设定描述", targetDir, targetFilename, "mp4", "0", "", "${starttime}-${id}-${seq}", "${id}", "0", "0", "0", "0",
                "0", "0", "0", "", "0", new CloudOutputGroupsFileArchiveOutput("-1","","")
        );
    }
}
